package Thread;

public class Test1 extends Thread {
    public void run(){
        for(int i=0;i<50;i++){
            System.out.println(Thread.currentThread().getName()+":"+i);
        }
    }

    public static void main(String[] args) {
        Test1 t1=new Test1();
        t1.setName("线路1");
        Test1 t2=new Test1();
        t2.setName("线路2");
        t1.start();
        t2.start();
        System.out.println(Thread.currentThread().getName()+"主线程开始运行");
        System.out.println(Thread.currentThread().getName()+"主线程运行结束");
    }
}
